<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePatternsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('patterns', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('ID');
            $table->integer('store_id')->index()->nullable()->comment('门店ID');
            $table->integer('scale_id')->index()->nullable()->comment('房间类型ID');
            $table->integer('business_time_id')->index()->nullable()->comment('时间段ID');
            $table->integer('type')->index()->default(1)->comment('消费模式：1.清唱、2.套餐、3.最低消费');
            $table->integer('current_price')->index()->default(0)->comment('时价：单位是分');
            $table->integer('add_price')->index()->default(0)->comment('加时价：单位是分');
            $table->integer('minimum_price')->index()->default(0)->comment('最低消费金额：单位是分');
            $table->integer('minimum_time')->index()->default(0)->comment('最低消费时间：单位是秒');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('patterns');
    }
}
